﻿CREATE FUNCTION [dbo].[sf_GetOrderDate]
(
	@Year varchar(4), 
	@Month varchar(2)
)
RETURNS INT
AS
BEGIN
	DECLARE @OrderDate VARCHAR(6)
	IF LEN(@Month) = 1
		SET @OrderDate = @Year + '0' + @Month
	ELSE
		SET @OrderDate = @Year + @Month
		
	RETURN CAST(@OrderDate AS INT)
END